package com.xyhs.b2c.oauth.controller;

import com.xyhs.b2c.oauth.utils.RedisUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author ljp
 * @apiNote
 * @date 14:06 2020/3/5
 **/
@RestController
@RequestMapping("/test")
@Slf4j
public class TestController {

    @Resource
    private RedisUtils<String> redisUtils ;

    @GetMapping("/v1")
   public String test(String key){
        boolean set = redisUtils.set("name", "ljp");
        log.info("set result is {}",set);
        String name = redisUtils.getString("name");
        log.info("The redis value is {}",name);
        log.info("The param is "+key);
        return "Tests v1 success";

   }
}
